<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>007-background-size</title>
		<style>
			.box1 {
				width: 400px;
				height: 400px;
				border: 1px solid black;
				background-image: url('./images/bg03.jpg');
				background-repeat: no-repeat;
				/* contain: 以图片最大的一边进行等比例缩放 */
				/* background-size: contain; */

				/* background-position: center center; */
				background-size: cover;
			}

			.box2 {
				width: 400px;
				height: 400px;
				border: 1px solid black;
				background-image: url('./images/你瞅啥.jpg');
				background-repeat: no-repeat;
				/* contain: 以图片最大的一边进行等比例缩放 */
				/* background-size: contain; */

				background-size: cover;
			}
		</style>
	</head>
	<body>
		<div class="box1"></div>
		<hr />
		<div class="box2"></div>
	</body>
</html>
